//
// Created by hjie on 23-6-23.
//

#pragma once

#include <string>
#include <cstring>
#include <memory>
#include <set>
#include <functional>
#include <map>
#include <rapidjson/document.h>
#include "../protocol/base_protocol.h"

class MessageRouter;

class BaseLogicModule
{
public:
    static void RegisterLogicModule();
public:
    BaseLogicModule();
    ~BaseLogicModule();
    virtual void RegisterMsg(MessageRouter * router) = 0;
    virtual void InitResponseHeader(rapidjson::Document & input, rapidjson::Document & output);
    virtual std::shared_ptr<BaseProtocol> CreateProtocolData(const std::string & msg, rapidjson::Document & input) = 0;
public:
    std::string m_module_name;
public:
    std::set<std::string> m_msg_type_set;
};
